Carbon


GetThemeWindowRegionHit

Header: Appearance.h Carbon status: Supported

Obtains the part of the window that the user clicked upon.

Boolean GetThemeWindowRegionHit (
    ThemeWindowType flavor, 
    const Rect *inContRect, 
    ThemeDrawState state, 
    const ThemeWindowMetrics *metrics, 
    ThemeWindowAttributes inAttributes, 
    Point inPoint, 
    WindowRegionCode *outRegionHit
);
flavor

A value of type ThemeWindowType. Pass a constant specifying the type of window to be examined. See “Theme Window Type Constants” for descriptions of possible values.

inContRect

A pointer to a structure of type Rect. Before calling GetThemeWindowRegionHit, set rectangle to the content area of the window, specified in coordinates local to the current port.

state

A value of type ThemeDrawState. Pass a constant—either kThemeStateActive or kThemeStateInactive—appropriate to the current state of the window. See “Theme Draw State Constants” for descriptions of these values.

metrics

A pointer to a structure of type ThemeWindowMetrics. Before calling GetThemeWindowRegionHit, set the structure to contain information describing the window.

inAttributes

A value of type ThemeWindowAttributes. Pass one or more constants corresponding to the window’s current visual attributes. See “Theme Window Attribute Constants” for descriptions of possible values. Pass 0 if the window has none of the enumerated attributes.

inPoint

A structure of type Point. Pass the point, specified in specified in coordinates local to the current port, where the mouse-down event occurred. Your application may retrieve this value from the where field of the event structure.

outRegionHit

A pointer to a value of type WindowRegionCode. On return, the value is set to the region code of the window part in which the point passed in the inPoint parameter is located.

function result

A value of type Boolean. If true, the mouse-down event occurred inside the window; otherwise, false.

DISCUSSION

Your window definition function should call the GetThemeWindowRegionHit function to determine where a specified mouse-down event occurred.

VERSION NOTES

This function is available with Appearance Manager 1.1 and later.

AVAILABILITY

Supported in Carbon. Available in Mac OS 8.1 and later when Carbon 1.0.2 or later is present.


© 2000 Apple Computer, Inc. — (Last Updated 5/8/2000)